package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.PaperType;
import business.PaperTypeService;
import dao.PaperTypeDAO;

public class PaperTypeServiceImpl implements PaperTypeService {

	private PaperTypeDAO paperTypeDao;

	public List<PaperType> getAll() {
		return paperTypeDao.findAll();
	}

	@Required
	public void setPaperTypeDao(PaperTypeDAO paperTypeDao) {
		this.paperTypeDao = paperTypeDao;
	}

	@Transactional
	public void insert(PaperType paperType) {
		paperTypeDao.create(paperType);
	}

	@Transactional
	public PaperType getById(long id) {
		return paperTypeDao.read(id);
	}
}